package com.lee.serviceagent.ocr.tesseractsec;

import net.sourceforge.tess4j.Tesseract;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lee
 * @description class
 * @date 2025/8/19 下午4:01
 */
@Configuration
public class TesseractConfig {
    @Bean
    public Tesseract tesseract() {
        Tesseract tesseract = new Tesseract();
        // 设置语言包路径，需要下载中文语言包(chi_sim.traineddata)
        tesseract.setDatapath("src/main/resources/tessdata");
        // 设置语言为中文简体
        tesseract.setLanguage("chi_sim");
        return tesseract;
    }
}
